package cn.changeforyou.web.controller;

import cn.changeforyou.web.dao.UserDao;
import cn.changeforyou.web.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhyu
 * @version 1.0
 * @date 2022/3/27 14:31
 */

@RestController
@RequestMapping("del")
public class DeleteController {

    @Autowired
    private UserDao userDao;

    @GetMapping("id")
    public int deleteById(Integer primaryKey) {
        return userDao.deleteById(primaryKey);
    }

    @PostMapping("entity")
    public int delete(@RequestBody User user) {
        return userDao.delete(user);
    }
}
